package vip.meet.type;

import java.util.HashMap;
import java.util.Map;

public enum UserStatus {

    VALID(1,"valid"),
    INVALID(0,"invalid");


    private Integer id;
    private String desc;
    
    private static final Map<Integer, UserStatus> idToEnum = new HashMap<Integer, UserStatus>();
    
    static {
        for (UserStatus op : values())
            idToEnum.put(op.id, op);
    }

    public static UserStatus getInstance(Integer id) {
        return idToEnum.get(id);
    }

    private UserStatus(Integer id, String desc){
        this.id = id;
        this.desc = desc;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    @Override
    public String toString() {
        return desc;
    }
}
